package com.airjoy.server.events {
	import flash.events.Event;
	import flash.net.Socket;
		
	/**
	 * ...
	 * @author Ricardo Teixeira
	 */
	public class JoyServerEvent extends Event {
		
		public static const CONNECT:String = "AIRJoyServerEvent.CONNECT";
		public static const DISCONNECT:String = "AIRJoyServerEvent.DISCONNECT";
		public static const DATA:String = "AIRJoyServerEvent.DATA";
		
		private var _client:Socket;
		
		public function JoyServerEvent(type:String, client:Socket = null, bubbles:Boolean=false, cancelable:Boolean=false) { 
			super(type, bubbles, cancelable);
			this._client = client;
		} 
		
		public override function clone():Event { 
			return new AIRJoyServerEvent(type, bubbles, cancelable);
		} 
		
		public override function toString():String { 
			return formatToString("AIRJoyServerEvent", "type", "bubbles", "cancelable", "eventPhase"); 
		}
		
		public function get client():Socket {
			return _client;
		}
		
	}
	
}